/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package koneksi;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author SONY
 */
public class CreateBarang {

    public static void main(String[] args) {
        try {
            Connection con = koneksi.CekKoneksi.open();
            Statement stt = con.createStatement();
            String in = "insert into BARANG(KODE_BARANG,NAMA_BARANG,HARGA_BARANG,JUMLAH)" + "values ('A001','Bread','3500','45')";
            String in1 = "insert into BARANG(KODE_BARANG,NAMA_BARANG,HARGA_BARANG,JUMLAH)" + "values ('A002','Snack','4500','30')";
            String in2 = "insert into BARANG(KODE_BARANG,NAMA_BARANG,HARGA_BARANG,JUMLAH)" + "values ('A003','Coffee','5700','35')";
            String in3 = "insert into BARANG(KODE_BARANG,NAMA_BARANG,HARGA_BARANG,JUMLAH)" + "values ('A004','Milk','25000','15')";
            String in4 = "insert into BARANG(KODE_BARANG,NAMA_BARANG,HARGA_BARANG,JUMLAH)" + "values ('B005','Biskuit','2000','50')";
            String in5 = "insert into BARANG(KODE_BARANG,NAMA_BARANG,HARGA_BARANG,JUMLAH)" + "values ('B006','Soap','3000','25')";
            String in6 = "insert into BARANG(KODE_BARANG,NAMA_BARANG,HARGA_BARANG,JUMLAH)" + "values ('B007','Shampoo','8000','35')";
            String in7 = "insert into BARANG(KODE_BARANG,NAMA_BARANG,HARGA_BARANG,JUMLAH)" + "values ('B008','Noodle','3200','40')";
            String in8 = "insert into BARANG(KODE_BARANG,NAMA_BARANG,HARGA_BARANG,JUMLAH)" + "values ('C009','Book','2200','25')";
            String in9 = "insert into BARANG(KODE_BARANG,NAMA_BARANG,HARGA_BARANG,JUMLAH)" + "values ('C0010','IceCream','5000','15')";
            String in10 = "insert into BARANG(KODE_BARANG,NAMA_BARANG,HARGA_BARANG,JUMLAH)" + "values ('C0011','Nugget','11000','20')";
            stt.executeUpdate(in);
            stt.executeUpdate(in1);
            stt.executeUpdate(in2);
            stt.executeUpdate(in3);
            stt.executeUpdate(in4);
            stt.executeUpdate(in5);
            stt.executeUpdate(in6);
            stt.executeUpdate(in7);
            stt.executeUpdate(in8);
            stt.executeUpdate(in9);
            stt.executeUpdate(in10);
        } catch (SQLException ex) {
            Logger.getLogger(CreateBarang.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
